import { Body, Controller, Post } from '@nestjs/common';
import { SysPageColumnService } from './pageColumn.service'
import {
  ApiOkResponse,
  ApiOperation,
  ApiSecurity,
  ApiTags,
} from '@nestjs/swagger';
import { ADMIN_PREFIX } from '../../admin.constants';
import { AdminUser } from '../../core/decorators/admin-user.decorator';
import { PermissionOptional } from '../../core/decorators/permission-optional.decorator';

@ApiSecurity(ADMIN_PREFIX)
@ApiTags('表头模块')
@Controller('pageColumn')
export class SysPageColumnController {
  constructor(private pageColumnService: SysPageColumnService) {}

  @ApiOperation({ summary: '获表头列表' })
  @ApiOkResponse()
  @PermissionOptional()
  @Post('list')
  async list(@Body() list,@AdminUser() user) {
    return await this.pageColumnService.list(list,user.uid)
  }

  @ApiOperation({ summary: '获取表头信息' })
  @ApiOkResponse()
  @PermissionOptional()
  @Post('update')
  async update(@Body() list,@AdminUser() user) {
    await this.pageColumnService.update(list,user.uid)
  }
}
